package com.labichaoka.chaoka.ui.baseinfo.real;

import com.labichaoka.chaoka.entity.BaseResponse;
import com.labichaoka.chaoka.entity.RealInfoRequest;

public class RealInfoPresenterImpl implements RealInfoPresenter,RealInfoInteractor.OnFinishedListener {

    private RealInfoView view;
    private RealInfoInteractor interactor;

    public RealInfoPresenterImpl(RealInfoView view, RealInfoInteractor interactor) {
        this.view = view;
        this.interactor = interactor;
    }

    @Override
    public void submitRealNameAuth(RealInfoRequest request) {
        if (view!=null){
            view.showProgress();
        }
        interactor.submitRealNameAuth(request,this);
    }

    @Override
    public void behavior(String actionNode) {
        interactor.behavior(actionNode);
    }

    @Override
    public void onDestroy() {
        view =null;
    }

    @Override
    public void onSubmitRealNameAuthSucc(BaseResponse response) {
        view.hideProgress();
        view.submitRealNameAuthCallback(response);
    }

    @Override
    public void onSubmitRealNameAuthFailed() {
        view.hideProgress();
    }
}
